# Maintainer: <matheus-catarino@hotmail.com>

_realname=nana
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.7.4
pkgrel=1
pkgdesc="An opensource cross-platform GUI library written in modern C++11 for static linking (mingw-w64)"
arch=('any')
url="https://github.com/cnjinhao/${_realname}"
license=("Custom:Boost Software License")
depends=("${MINGW_PACKAGE_PREFIX}-libpng" "${MINGW_PACKAGE_PREFIX}-libjpeg-turbo")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-cmake")
source=("${_realname}-v${pkgver}.tar.gz"::"https://github.com/cnjinhao/${_realname}/archive/v${pkgver}.tar.gz")
sha256sums=('56F7B1ED006C750FCCF8EF15AB1E83F96751F2DFDCB68D93E5F712A6C9B58BCB')

build() {
    cd ${srcdir}/${_realname}-${pkgver}
        MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
        ${MINGW_PREFIX}/bin/cmake \
        -G"MSYS Makefiles" \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
        -DNANA_CMAKE_ENABLE_JPEG=YES \
        -DNANA_CMAKE_ENABLE_PNG=YES \
        -DNANA_CMAKE_INSTALL=YES \
        -DNANA_CMAKE_NANA_FILESYSTEM_FORCE=NO \
        -DNANA_CMAKE_STD_FILESYSTEM_FORCE=YES
    
    make
}

package() {
    cd ${srcdir}/${_realname}-${pkgver}
    make install DESTDIR="${pkgdir}"
}
